package com.neymar.mapper;

import com.neymar.entity.Company;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 公司表 Mapper 接口
 * </p>
 *
 * @author neymar
 * @since 2021-06-02
 */
public interface CompanyMapper extends BaseMapper<Company> {


    @Select(
            "select b.*,c.* from information.company a, information.recruiter b, information.position c\n"
                    + "where a.company_id =${id} and a.company_id=b.recruiter_company_id "
                    + "and b.user_id = c.publisher_id "
                    + "limit ${(current-1)*size},${size}"
    )
    List<Map<String, String>> findCompanyDetails(@Param("id") String companyId, @Param("current") Integer current, @Param("size") Integer size);
}
